package cn.edu.tju.core.security.rest.dto;

import cn.edu.tju.core.model.Authority;

import java.util.Set;

/**
 * DTO for login response.
 */
public class LoginResponse {

   private String token;
   private String username;
   private Long userId;
   private String userImg;
   private Integer userSex;
   private Set<Authority> authorities;
   private Long businessId;

   public LoginResponse() {
   }

   public LoginResponse(String token, String username, Long userId, String userImg, Integer userSex, Set<Authority> authorities) {
      this.token = token;
      this.username = username;
      this.userId = userId;
      this.userImg = userImg;
      this.userSex = userSex;
      this.authorities = authorities;
   }

   public LoginResponse(String token, String username, Long userId, String userImg, Integer userSex, Set<Authority> authorities, Long businessId) {
      this.token = token;
      this.username = username;
      this.userId = userId;
      this.userImg = userImg;
      this.userSex = userSex;
      this.authorities = authorities;
      this.businessId = businessId;
   }

   public String getToken() {
      return token;
   }

   public void setToken(String token) {
      this.token = token;
   }

   public String getUsername() {
      return username;
   }

   public void setUsername(String username) {
      this.username = username;
   }

   public Long getUserId() {
      return userId;
   }

   public void setUserId(Long userId) {
      this.userId = userId;
   }

   public String getUserImg() {
      return userImg;
   }

   public void setUserImg(String userImg) {
      this.userImg = userImg;
   }

   public Integer getUserSex() {
      return userSex;
   }

   public void setUserSex(Integer userSex) {
      this.userSex = userSex;
   }

   public Set<Authority> getAuthorities() {
      return authorities;
   }

   public void setAuthorities(Set<Authority> authorities) {
      this.authorities = authorities;
   }

   public Long getBusinessId() {
      return businessId;
   }

   public void setBusinessId(Long businessId) {
      this.businessId = businessId;
   }

   @Override
   public String toString() {
      return "LoginResponse{" +
         "token='[HIDDEN]'" +
         ", username='" + username + '\'' +
         ", userId=" + userId +
         ", userSex=" + userSex +
         '}';
   }
}
